<script>
	export default {
		onError(err) {
			// try {
			// 	// 挂载devTools全局报错拦截
			// 	uni.$dev.errorReport(err, "at App.vue onError", "oe");
			// } catch (error) {}
		},

		onLaunch: function(e) {
			console.log('App Launch')

			const updateManager = uni.getUpdateManager();

			updateManager.onCheckForUpdate(function(res) {
				// 请求完新版本信息的回调
				// console.log(res.hasUpdate);
			});

			updateManager.onUpdateReady(function(res) {
				uni.showModal({
					title: '更新提示',
					content: '新版本已经准备好，是否重启应用？',
					success(res) {
						if (res.confirm) {
							// 新的版本已经下载好，调用 applyUpdate 应用新版本并重启
							updateManager.applyUpdate();
						}
					}
				});
			});

			updateManager.onUpdateFailed(function(res) {
				// 新的版本下载失败
			});

			const systemInfo = uni.getSystemInfoSync();

			if (systemInfo.platform === 'ios') {

				//苹果 静音播放
				uni.setInnerAudioOption({
					obeyMuteSwitch: false
				})

				console.log('当前设备是苹果手机（iOS）');
			} else {
				console.log('当前设备不是苹果手机');
			}


			// const userStore = useStore()
			// await userStore.user.getUserinfo()

			// http.getUserinfo()

			// try {
			// 	// 挂载APP启动日志提交
			// 	uni.$dev.logReport("appOnLaunch>" + JSON.stringify(option));
			// } catch (error) {}
		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style lang="scss">
	@import "./uni_modules/vk-uview-ui/index.scss";

	/*每个页面公共css */
	@import '@/assets/style/font.css';
	
@import "@/uni_modules/vk-uview-ui/theme.scss";

	page {
		display: flex;
		flex-direction: column;
		height: 100%;
	}

	view {
		box-sizing: border-box;
	}

	text {
		font-family: PingFang;
	}

	/* 说话图标 */
	.voice-line-wrap {
		position: absolute;
		bottom: 100rpx;
		left: 50%;
		margin-left: -78rpx;
		width: 156rpx;
		display: flex;
		align-items: center;

		.voice-line {
			width: 5rpx;
			height: var(--line-height);
			border-radius: 3rpx;
			margin: 0 5rpx;
		}

		.one {
			animation: wave 0.4s 1s linear infinite alternate;
		}

		.two {
			animation: wave 0.4s 0.9s linear infinite alternate;
		}

		.three {
			animation: wave 0.4s 0.8s linear infinite alternate;
		}

		.four {
			animation: wave 0.4s 0.7s linear infinite alternate;
		}

		.five {
			animation: wave 0.4s 0.6s linear infinite alternate;
		}

		.six {
			animation: wave 0.4s 0.5s linear infinite alternate;
		}

		.seven {
			animation: wave 0.4s linear infinite alternate;
		}
	}

	@keyframes wave {
		0% {
			transform: scale(1, 1);
			background-color: var(--line-start-color);
		}

		100% {
			transform: scale(1, 0.2);
			background-color: var(--line-end-color);
		}
	}

	// loadding
	.loader {
		width: 120rpx;
		aspect-ratio: 4;
		--c: #333 90%, #0000;
		background: radial-gradient(circle closest-side at left 12rpx top 50%,
				var(--c)),
			radial-gradient(circle closest-side, var(--c)),
			radial-gradient(circle closest-side at right 12rpx top 50%, var(--c));
		background-size: 100% 100%;
		background-repeat: no-repeat;
		animation: l4 1s infinite alternate;
	}

	@keyframes l4 {
		to {
			width: 30rpx;
			aspect-ratio: 1;
		}
	}
</style>